﻿/**
 * ...
 * @author wangjun
 */
import gs.TweenLite;
import mx.utils.Delegate;
import cn.eminia.A2.io.Rat;
class cn.eminia.A2.Forms.MessageBox.HandDoBox extends MovieClip
{
	
	public function HandDoBox() 
	{
		this._visible = false;
		
	}   
	public function show(id, vars:Object) {  
		if (id != null) {
			if (id.constructor == String) 
			{
				this['tf'].text = id;
			}
			else if(id.constructor == Number)
			{
				this.gotoAndStop(id);
			}
		}
		var clickArea = (vars.clickArea != null) ? vars.clickArea : vars.mc;
		trace("ia am here")
		
		this._visible 	= true;
		this._alpha 	= 0;
		TweenLite.to(this, .6, {_alpha:100});
		//this.tf.autoSize = true;  
		Rat.isClick(this,clickArea, {
							callback:Delegate.create(this, function () {
								hidden();
							}) 
					} );
		if (vars.autoHidden) {
			TweenLite.to(this, .6, { 
					overwrite:false,
					delay:3, 
					onCompleteScope:this,
					onComplete:function () {
						this.hidden(); 
					} 
				})
		}
	}
	public function hidden() {
		TweenLite.to(this, .6, {
				_alpha:0, 
				onComplete:function () {
					this._visible = false;
				}
				});
	} 
	
}